Fix calling Eshell scripts outside of Eshell
authorJim Porter <jporterbugs@gmail.com>
Mon, 20 May 2024 15:59:02 +0000 (08:59 -0700)
committerJim Porter <jporterbugs@gmail.com>
Wed, 29 May 2024 19:11:58 +0000 (12:11 -0700)
commit9280a619ab3141c0b3b8f4ae876f82e6a38c757f
tree0e1e83676be3f120c52f554ad2de1d9d5bf7df9c
parenteac608cb8041222ba3b2eac48ac6f76ac36bab16
Fix calling Eshell scripts outside of Eshell

* lisp/eshell/em-script.el (eshell-source-file): Make obsolete.
(eshell--source-file): Adapt from 'eshell-source-file'...
(eshell-script-initialize, eshell/source, eshell/.): ... use it.
(eshell-princ-target): New struct.
(eshell-output-object-to-target, eshell-target-line-oriented-p): New
implementations for 'eshell-princ-target'.
(eshell-execute-file, eshell-batch-file): New functions.

* lisp/eshell/esh-mode.el (eshell-mode): Just warn if we can't create
the Eshell directory.

* test/lisp/eshell/em-script-tests.el (em-script-test/execute-file):
(em-script-test/execute-file/args), em-script-test/batch-file): New
tests.

* test/lisp/eshell/eshell-tests-helpers.el (with-temp-eshell-settings):
New function...
(with-temp-eshell): ... use it.

* doc/misc/eshell.texi (Control Flow): Update documentation.

* etc/NEWS: Announce this change (bug#70847).
doc/misc/eshell.texi
etc/NEWS
lisp/eshell/em-script.el
lisp/eshell/esh-mode.el
test/lisp/eshell/em-script-tests.el
test/lisp/eshell/eshell-tests-helpers.el